<script >
import title1 from '../components/title.vue'
import Navigation from '../components/navigation_tea.vue'
import Nav from "../components/navigation_stu.vue";
export default {
  name: 'tea_grade',
  components:
      {
        title1,
        Navigation
      },
  mounted() {
    document.title = '教师信息管理系统';
    const token = localStorage.getItem('token'); // 确保 token 已正确存储
    const userNo = sessionStorage.getItem('UserNo'); // 确保 UserNo 已正确存储
    if (!token || !userNo) {
      alert('缺少必要的认证信息，请重新登录。');
      this.$router.push({ name: "Login" });
    }
  },
}
</script>

<template>
  <text class="sub-title"> — 批改学生成绩</text>
  <title1></title1>
  <Navigation></Navigation>
  <el-container style="position: fixed;top: 120px;left: 500px;">
      <el-text>请输入课程号:</el-text>
      <el-input v-model="Cno" style="padding-left: 10px; width: 120px" placeholder="" />
      <el-button plain @click="search" style="margin-left: 50px">
        检索课程
      </el-button>
      <el-button plain @click="submit" style="margin-left: 30px">
        提交批改
      </el-button>
  </el-container>
  <el-table :data="tableData"  class="grade_table" border style=" width: 75%">
    <el-table-column
        type="index"
        label="序号"
        width="60"
        align="center"
    ></el-table-column>
    <el-table-column
        prop="cname"
        label="课程名"
        min-width="100px"
        align="center"
        :show-overflow-tooltip="true"
    ></el-table-column>
    <el-table-column
        prop="sno"
        label="学生学号"
        min-width="100px"
        align="center"
        :show-overflow-tooltip="true"
    ></el-table-column>
    <el-table-column
        prop="sname"
        label="学生姓名"
        min-width="100px"
        align="center"
        :show-overflow-tooltip="true"
    ></el-table-column>
    <el-table-column
        prop="sgrade"
        label="成绩"
        min-width="100px"
        align="center"
        :show-overflow-tooltip="true"
    ></el-table-column>
  </el-table>
</template>

<style scoped>
.sub-title{
  z-index: 2;
  position: fixed;
  top: 35px;
  left: 380px;
  color: #0e4bbd;
  font-size: 30px;
  font-weight: normal;
}
.grade_table{
  position: fixed;
  top: 200px;
  left: 280px;
}
</style>